<?php

namespace Common\Model;

/**
 * ServerModel.class.php实例模型
 * 
 * @author wenhui
 * @date 2017-011-09
 */
class ServerModel extends BaseModel {

    protected $trueTableName = 'tb_server';

    /**
     * 添加数据
     * @modify wenhui 2017-011-09
     * @param integer $name  服务名称
     * @return type
     */
    public function addInfo($name) {
        $options = array(
            'name' => $name,
        );
        return $this->add($options);
    }

    /**
     * 添加数据
     * @modify wenhui 2017-011-09
     * @param integer $name  服务名称
     * @return type
     */
    public function saveInfo($serverId, $name) {
        $data = array();

        $options['id'] = $serverId;
        $data['name'] = $name;

        return $this->where($options)->save($data) === false ? false : true;
    }
}
